Add CI job to report main branch build failures via GitHub issues#4418
Add CI job to report main branch build failures via GitHub issues#4418joostjager wants to merge 1 commit intolightningdevkit:mainfrom
Conversation
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
d002d08 to
4641656
Compare
|
For |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4418 +/- ##
==========================================
- Coverage 86.07% 86.06% -0.01%
==========================================
Files 156 156
Lines 103442 103442
Branches 103442 103442
==========================================
- Hits 89033 89029 -4
- Misses 11894 11900 +6
+ Partials 2515 2513 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
.github/workflows/build.yml
Outdated
| - uses: jayqi/failed-build-issue-action@1a893bbf43ef1c2a8705e2b115cd4f0fe3c5649b # v1.2.0 | ||
| id: create-issue | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Can we somehow restrict this to only opening new issues?
There was a problem hiding this comment.
I don't think it can be more granular than "issues: write", which also allows updating. That is useful to amend an already existing, unresolved, build issue.
.github/workflows/build.yml
Outdated
| - name: Assign issue to committer | ||
| if: steps.create-issue.outputs.issue-number | ||
| run: | | ||
| gh issue edit ${{ steps.create-issue.outputs.issue-number }} \ |
There was a problem hiding this comment.
If we can use the standard github tooling can we just use gh issue create instead of jayqi/failed-build-issue-action?
Automatically creates or comments on a "build failed" issue when any CI job fails on the main branch, and assigns it to the committer who triggered the failure. Uses inline gh CLI commands to avoid a third-party action dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4641656 to
3a61ec2
Compare
Adds a
notify-failurejob to the main CI workflow (build.yml) that automatically creates a GitHub issue when the main branch build fails. The job uses inlineghCLI commands (no third-party action dependency) to create or comment on an issue labeled "build failed". It triggers onmainbranch pushes when at least one job inbuild.ymlhas failed.The job depends on all existing jobs in
build.ymland runs after they complete. If any job fails, it either creates a new issue with the "build failed" label or adds a comment to an existing open issue with that label. Each comment includes the workflow run link, event, branch, commit, and committer (as an @-mention). Closing the issue signals the problem is resolved; subsequent failures will create a fresh issue. The first committer whose push triggers a failure is assigned to the issue; subsequent failures that add comments do not reassign.Note that this only covers jobs in
build.yml. Other workflows that run on main pushes (semver.yml,ldk-node-integration.yml) are not covered yet, as GitHub Actionsneedscannot cross workflow boundaries. Expanding coverage would require some restructuring (e.g., converting them to reusable workflows or duplicating the notification job).Permissions are scoped to
issues: writeonly, so the token cannot be used to push code, modify workflows, or access secrets.Tested on the main branch of my fork by deliberately breaking the build. The action successfully created an issue: joostjager#7